package cn.lagou.Homework.RockPaperScissor

import scala.util.Random

class Computer(override val name: String) extends Player {
  override var score: Int = 0

  override def showFist(): String = {
    println(s"${name}出拳！")
    val result = Random.nextInt(2) + 1 match {
      case 1 => "石头"
      case 2 => "剪刀"
      case 3 => "布"
    }
    println(s"${name}出拳:${result}")
    result
  }
}
